<template>
  <VirtualScroll
    :data="bigData"
    :item-height="50"
    :container-height="500"
  >
    <!-- 自定义渲染内容 -->
    <template #default="{ item }">
      <div style="color: blue;">
        {{ item.id }}. {{ item.content }}
      </div>
    </template>
  </VirtualScroll>
</template>

<script setup>
import VirtualScroll from './virtualComponent.vue';

// 生成10万条测试数据
const bigData = Array.from({ length: 100000 }, (_, i) => ({
  id: i,
  content: `Item ${i} - ${Math.random().toString(16).slice(2, 8)}`,
}));


</script>